import { reactive } from "vue";
import type { FormRules } from "element-plus";
import { isPhone } from "@pureadmin/utils";

/** 自定义表单规则校验 */
export const formRules = reactive(<FormRules>{
	deviceType: [{ required: true, message: "零件分类名称为必填项", trigger: "change" }],
  deviceName: [{ required: true, message: "设备名称为必填项", trigger: "blur" }],
  deviceUnit: [{ required: true, message: "设备单位为必填项", trigger: "blur" }],
  originType: [{ required: true, message: "设备类型为必填项", trigger: "change" }],
  isForeign: [{ required: true, message: "国产/进口为必填项", trigger: "change" }],
  price: [{ required: true, message: "价格为必填项", trigger: "blur" }],
  brandId: [{ required: true, message: "品牌为必填项", trigger: "change" }],
  supplierId: [{ required: true, message: "供应商为必填项", trigger: "change" }],
  specLength: [{ required: true, message: "长度为必填项", trigger: "blur" }],
  specWidth: [{ required: true, message: "宽度为必填项", trigger: "blur" }],
  specHeight: [{ required: true, message: "高度为必填项", trigger: "blur" }],
  specAngle: [{ required: true, message: "角度为必填项", trigger: "blur" }],
  power: [{ required: true, message: "功率为必填项", trigger: "blur" }],
  speed: [{ required: true, message: "速度为必填项", trigger: "blur" }],
  efficiency: [{ required: true, message: "效率为必填项", trigger: "blur" }],
  maxLoad: [{ required: true, message: "最大载重为必填项", trigger: "blur" }],
});
